<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<LINK href="images/css.css" type="text/css" rel="stylesheet">
</head>
<body>
  <table class="tableline" cellspacing="1" cellpadding="0" width="100%" border="0">
       
   <c:if test="${UpdateClazz == 'add' }">
   <html:form action="clazz.do?method=save" method="post" >
   <html:hidden property="deptid" value="${dept.id}"/>
    <tr>
      <td class="STYLE4" align="center" bgcolor="#ffffff" colspan="2" height="40">添加修改院系班级</td>
    </tr>
    <tr>
      <td width="217" height="26" align="right" bgcolor="#ffffff">班级号:</td>
      <td width="773" bgcolor="#ffffff"><label for="textfield"></label>
        &nbsp;<html:text property="clazzId" value="${clazz.clazzId }"/>
        <font color="red">${clazzError }${clazzIdRequest }</font></td>
    </tr>
    <tr>
      <td height="26" align="right" bgcolor="#ffffff">班级名称:</td>
      <td bgcolor="#ffffff"><label for="textfield2"></label>
       &nbsp;<html:text property="clazzName" value="${clazz.clazzName }"/>
        &nbsp;&nbsp;<font color="red">${clazzNameError }</font></td>
    </tr>
    <tr>
      <td height="26" align="right" bgcolor="#ffffff">所属院系:</td>
      <td bgcolor="#ffffff"><label for="textfield2"></label>
       &nbsp;${dept.deptName }&nbsp;&nbsp;&nbsp;<html:submit value="增加班级" />
      </td>
    </tr>
    </html:form>
   </c:if>
   
   <c:if test="${UpdateClazz == 'update' }">
   <html:form action="clazz.do?method=updateSave" method="post" >
   <html:hidden property="deptid" value="${dept.id}"/>
   <html:hidden property="id" value="${clazz.id}"/>
    <tr>
      <td class="STYLE4" align="center" bgcolor="#ffffff" colspan="2" height="40">添加修改院系班级</td>
    </tr>
    <tr>
      <td width="217" height="26" align="right" bgcolor="#ffffff">班级号:</td>
      <td width="773" bgcolor="#ffffff"><label for="textfield"></label>
        &nbsp;<html:text property="clazzId" value="${clazz.clazzId }"/>
        <font color="red">${clazzError }${clazzIdRequest }</font></td>
    </tr>
    <tr>
      <td height="26" align="right" bgcolor="#ffffff">班级名称:</td>
      <td bgcolor="#ffffff"><label for="textfield2"></label>
       &nbsp;<html:text property="clazzName" value="${clazz.clazzName }"/>
        &nbsp;&nbsp;<font color="red">${clazzNameError }</font></td>
    </tr>
    <tr>
      <td height="26" align="right" bgcolor="#ffffff">所属院系:</td>
      <td bgcolor="#ffffff"><label for="textfield2"></label>
       &nbsp;${dept.deptName }&nbsp;&nbsp;&nbsp;<html:submit value="修改班级" />
      </td>
    </tr>
    </html:form>
   </c:if>
    
    <tr>
      <td colspan="2" align="center" bgcolor="#ffffff">
      <table width="100%" border="0">
        <tr align="center">
          <td width="25%" height="25">班级号列表</td>
          <td width="25%">班级名称</td>
          <td width="25%">操作</td>
        </tr>
        <c:if test="${!empty clazzList}">
				<c:forEach items="${clazzList}" var="clazz">
        <tr align="center">
          <td height="25">${clazz.clazzId }</td>
          <td>${clazz.clazzName }</td>
          <td><a href="clazz.do?method=update&id=${clazz.id }&&deptid=${dept.id}">编辑</a>&nbsp;<a href="clazz.do?method=delete&id=${clazz.id }&&deptid=${dept.id}">删除</a></td>
        </tr>
        </c:forEach>
        </c:if>
      </table>
      </td>
    </tr>
  </table>
</body>
</html>